<?php

/*
 * реализация
 * $form->fileField(CModel $model, string $attribute, array $htmlOptions=array ( ));
 */

function smarty_function_afFileField($params, &$smarty)
{
    $widget = $smarty->getTemplateVars("_widgetActiveForm");
    $model = $smarty->getTemplateVars("_modelForWidgetActiveForm");
    if (!$widget)
    {
        throw new CException(Yii::t('afFileField must be applay fot widget ActiveForm'));
    }
    echo $widget->fileField($model, $params['property'], $params['attr']);
}